<#macro page data url="" search_param="">
<#if data.page==1>
     <li disabled><span>&laquo;</span></li>
     <#else>
     <li ><a data-open="${url}?id=${data.param['box_id']}&page=${data.page-1}${search_param!""}" href="javascript:void(0);">&laquo;</a></li>
     </#if>
     <#if data.totalPage lte 7>
     	<#list 1..data.totalPage as page1>
			 	<#if page1 == data.page >
				 	<li class="active"><span>${page1}</span></li>
				 <#elseif page1 gt 0>
				 	<li><a data-open="${url}?id=${data.param['box_id']}&page=${page1}${search_param!""}" href="javascript:void(0);">${page1}</a></li>
				 </#if>
	    </#list>
     <#else>
     	<#if data.page lt 5>
			 <#list 1..5 as page1>
			 	<#if page1 == data.page >
				 	<li class="active"><span>${page1}</span></li>
				 <#elseif page1 gt 0>
				 	<li><a data-open="${url}?id=${data.param['box_id']}&page=${page1}${search_param!""}" href="javascript:void(0);">${page1}</a></li>
				 </#if>
	    	</#list>
	    	<li><a  href="javascript:void(0);">...</a></li>
	    	<li><a data-open="${url}?id=${data.param['box_id']}&page=${data.totalPage}${search_param!""}" href="javascript:void(0);">${data.totalPage}</a></li>
	    <#elseif (data.totalPage-data.page) gt 4>
	    	<li><a data-open="${url}?id=${data.param['box_id']}&page=1${search_param!""}" href="javascript:void(0);">1</a></li>
	    	<li><a data-open="#" href="javascript:void(0);">...</a></li>
	    	<#list (data.page-2)..(data.page+2) as page1>
			 	<#if page1 == data.page >
				 	<li class="active"><span>${page1}</span></li>
				 <#elseif page1 gt 0>
				 	<li><a data-open="${url}?id=${data.param['box_id']}&page=${page1}${search_param!""}" href="javascript:void(0);">${page1}</a></li>
				 </#if>
	    	</#list>
	    	<li><a  href="javascript:void(0);">...</a></li>
	    	<li><a data-open="${url}?id=${data.param['box_id']}&page=${data.totalPage}${search_param!""}" href="javascript:void(0);">${data.totalPage}</a></li>
     	<#else>
     		<li><a data-open="${url}?id=${data.param['box_id']}&page=1${search_param!""}" href="javascript:void(0);">1</a></li>
	    	<li><a href="javascript:void(0);">...</a></li>
	    	<#list (data.totalPage-5)..data.totalPage as page1>
			 	<#if page1 == data.page >
				 	<li class="active"><span>${page1}</span></li>
				 <#elseif page1 gt 0>
				 	<li><a data-open="${url}?id=${data.param['box_id']}&page=${page1}${search_param!""}" href="javascript:void(0);">${page1}</a></li>
				 </#if>
	    	</#list>
     	</#if>
     </#if>
 	<#if data.page==data.totalPage >
		<li disabled><span>&raquo;</span></li>
	<#else>
		<li><a data-open="${url}?id=${data.param['box_id']}&page=${data.page+1}${search_param!""}" href="javascript:void(0);">&raquo;</a></li>
	</#if>
</#macro>